package com.example.mountainwalker.mapper;

import com.example.mountainwalker.entity.ManagerInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ManagerMapper {
    @Select("select * from manager")
    List<ManagerInfo> getManagerInfo();

    @Select("select * from manager where admin_id = #{id}")
    ManagerInfo getManagerInfoById(Integer id);

    @Delete("delete from manager where admin_id = #{id}")
    int deleteManagerInfoById(Integer id);

    @Insert("insert into manager (admin_id, admin_name, admin_password) values(#{adminId}, #{adminName}, #{adminPassword})")
    int insertManagerInfo(ManagerInfo managerInfo);

    @Select("select * from manager where admin_name = #{adminName}")
    ManagerInfo getManagerInfoByName(String adminName);
}
